package com.joolun.cloud.mall.api.util;

import com.joolun.cloud.mall.common.constant.MallConstants;
import com.joolun.cloud.weixin.common.constant.ConfigConstant;

import javax.servlet.http.HttpServletRequest;

/**
 * Api工具类
 */
public class ApiUtil {
	/**
	 * 通过request获取appId
	 * @param request
	 * @return
	 * @throws Exception
	 */
	public static String getAppId(HttpServletRequest request) {
		String appId = request.getHeader(MallConstants.HEADER_APP_ID);
		return appId;
	}

	/**
	 * 通过request获取clientType
	 * @param request
	 * @return
	 * @throws Exception
	 */
	public static String getClientType(HttpServletRequest request) {
		String clientType = request.getHeader(MallConstants.HEADER_CLIENT_TYPE);
		return clientType;
	}
}
